class SingletonDict:
    _instance = None
    
    def __new__(cls):
        if cls._instance is None:
            cls._instance = super(SingletonDict, cls).__new__(cls)
            cls._instance.dict = {}  # 初始化字典
        return cls._instance
    
    def add(self, key, value):
        self.dict[key] = value
    
    def get(self, key):
        return self.dict.get(key)
 
# 使用示例：
singleton_dict = SingletonDict()
singleton_dict.add('key', 'value')
print(singleton_dict.get('key'))  # 输出: value


